package com.tl.web.controller.weixin;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.tl.common.core.controller.BaseController;
import com.tl.common.core.domain.AjaxResult;
import com.tl.wechat.pay.utils.WXPayUtil;


/**
 * 微信支付
 * @author 15110
 *
 */
@Controller
@RequestMapping("/wxPay")
public class WxPayController extends BaseController{
	
	
	
	/**
	 * 支付回调
	 * @param xmlData
	 * @return
	 * @throws WxPayException
	 */
	@PostMapping("/notifyOrder")
	public void parseOrderNotifyResult(@RequestBody String xmlData) {		
		System.out.println("《《《===微信支付回调开始===》》》");
		try {
			Map<String, Object> map=WXPayUtil.xmlToMap(xmlData);
			System.out.println("《《《===微信支付回调信息===》》》："+map.toString());
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("《《《===微信支付回调执行失败===》》》："+e.getMessage());
		}
	}
	

}
